<template>
	<view class="allIndent-mod">
		<view class="allIndent-mod-head">
			<stairNav :list="navList" @stairNavClick="stairNavClick"></stairNav>
			<secondaryNav :list="navList[stairNavIndex].secondNavList" @secondClick="secondClick"></secondaryNav>
		</view>
		<view class="" v-if="navList[stairNavIndex].secondNavList[secondNavIndex].children!=''">
			<scroll-view scroll-y="true" class="allIndent-mod-content" >
				<view class="allIndent-content-item fz"
					v-for="item,index in navList[stairNavIndex].secondNavList[secondNavIndex].children">
					<view class="flex">
						<view class="allIndent-item-title">
							{{item.title}}
						</view>
						<view class="">
			
						</view>
					</view>
					<view class="a-content-classfiy content-classfiy-time">
						<text>服务时间:</text><text>{{item.date | time}} {{item.time}} : 00</text>
					</view>
					<view class="a-content-classfiy">
						<text>服务地址:</text><text>{{item.address}}{{item.houseNumber}}</text>
					</view>
					<view class="a-content-classfiy">
						<text>服务商家:</text><text>成都洁净到家家政服务有限公司</text>
					</view>
					<view class="a-content-classfiy">
						<text>服务报价:</text><text>{{item.subPrice}}元/次</text>
					</view>
					<view class="flex total">
						合计:<text>
							<text class="fw fz">￥</text>
							<text class="allIndent-item-price">{{item.subPrice}}</text>
						</text>
					</view>
					<view class="flex flex-bottom">
						<view class="color">
							再来一单
						</view>
					</view>
				</view>
				<view class="flex center fz gray">
					已加载全部数据
				</view>
			</scroll-view>
		</view>
		<view class="content-null" v-else> 
			<image src="../../static/detailImg/allIndent.jpg" mode="" class="width"></image>
		</view>
	</view>
</template>

<script>
	import stairNav from "../../components/stairNav/stairNav.vue"
	import secondaryNav from "../../components/secondaryNav/secondaryNav.vue"
	export default {
		name: 'allIndent',
		onLoad(obj) {
			if (obj !== null) {
				if (!obj.title) {
					uni.setNavigationBarTitle({
						title: obj.title
					})
				}
			}
		},
		components: {
			stairNav,
			secondaryNav
		},
		data() {
			return {
				navList: [{
						title: '到家服务',
						secondNavList: [{
							title: '全部',
							children: []
						}, {
							title: '待支付',
							children: []
						}, {
							title: '待接单',
							children: []
						}, {
							title: '待服务',
							children: []
						}, {
							title: '已完成',
							children: []
						}, ]
					},
					{
						title: '服务管理',
						secondNavList: ['全部', '待支付', '已支付', '服务完成']
					},
					{
						title: '优惠券/券包',
						secondNavList: ['全部', '待支付', '待使用', '已完成', '已取消']
					},
					{
						title: '搬家',
						secondNavList: []
					}
				],
				stairNavIndex: 0,
				secondNavIndex: 0,

			}
		},
		computed: {
			
		},
		created() {
			this.navList[0].secondNavList[0].children = JSON.parse(localStorage.getItem('allIndentDataList'))
		},
		methods: {
			stairNavClick(index) {
				this.stairNavIndex = index
			},
			secondClick(index) {
				this.secondNavIndex = index
			}
		},
		filters:{
			time(val){
				let date = new Date(val)
				let y = date.getFullYear()
				let m = date.getMonth() + 1
				m = m < 10 ? '0' + m : m;
				let d = date.getDate()
				return y+'-'+m + '-' + d 
			}
		}

	}
</script>

<style>
</style>
